import 'package:flutter/cupertino.dart';

class ImageWidget extends StatelessWidget {
  /// 图片地址
  String url;

  final double? width;
  final double? height;

  ImageWidget({
    Key? key,
    required this.url,
    this.width,
    this.height,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    // print("url is ${url}");
    return Image.network(url,
        fit: BoxFit.cover,
        width: width,
        height: height, errorBuilder: ((context, error, stackTrace) {
          return Image.asset("assets/images/image_picker_placehold.webp");
        }));
  }
}
